//
//  ZH_RefundTitleTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/11/1.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_RefundTitleTableViewCell.h"
@interface ZH_RefundTitleTableViewCell()
@property (nonatomic,weak)UIView *cricleView;
@property (nonatomic,weak)UILabel *titleLabel;

@end
@implementation ZH_RefundTitleTableViewCell

+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_RefundTitleTableViewCell";
    ZH_RefundTitleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_RefundTitleTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
- (void)initDefault{
    [self unShowClickEffect];
}
- (void)loadSubviewConstraints{
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(15));
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(FITSCALE(25));
    }];
    [self.cricleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.contentView).offset(FITSCALE(9));
        make.width.mas_equalTo(FITSCALE(9));
        make.height.mas_equalTo(FITSCALE(9));
    }];
}
#pragma mark - getter,setter
- (UIView *)cricleView{
    if (!_cricleView) {
        UIView *view = [UIView createViewWithBackgroundColor:[UIColor colorWithHexString:@"#DFDFDF"]];
        view.layer.cornerRadius = FITSCALE(4);
        view.layer.masksToBounds = YES;
        view.clipsToBounds = YES;
        [self.contentView addSubview:_cricleView = view];
    }
    return _cricleView;
}
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        UILabel *label = [UILabel createLabelWithText:@"上传凭证 (最多3张):" font:kFontSize_28];
        label.textColor = [UIColor colorWithHexString:@"#333333"];
        label.textAlignment = NSTextAlignmentRight;
        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc]initWithString:label.text];
        NSDictionary *dic = @{NSFontAttributeName:kFontSize_22,NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#999999"]};
        [attr setAttributes:dic range:[label.text rangeOfString:@"(最多3张)"]];
        label.attributedText = attr;
        [self.contentView addSubview:_titleLabel = label];
    }
    return _titleLabel;
}
@end
